<#macro paginate currentPage totalPage actionUrl ui urlParas="">
	<#if (totalPage <= 0) || (currentPage > totalPage)><#return></#if>
	<#local startPage = currentPage - 4>
	<#if (startPage < 1)><#local startPage = 1></#if>
	
	<#local endPage = currentPage + 4>
	<#if (endPage > totalPage)><#local endPage = totalPage></#if>
	
	<ul class="pagination">
			<#if (currentPage <= 8)>
				<#local startPage = 1>
			</#if>
			<#if ((totalPage - currentPage) < 8)>
				<#local endPage = totalPage>
			</#if>
			
			<#if (currentPage == 1)>
				<li class="disabled">
			      <a href="#" aria-label="Previous">
			        <span aria-hidden="true">&laquo;</span>
			      </a>
				</li>
			<#else>
				<li>
			      <a href="#" aria-label="Previous" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${currentPage - 1}')">
			        <span aria-hidden="true">&laquo;</span>
			      </a>
				</li>
			</#if>
			
			<#if (currentPage > 8)>
				<li><a href="#" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${1}')">#{1}</a></li>
				<li><a href="#" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${2}')">#{2}</a></li>
				<li><a href="#" class="gap">…</a></li>
			</#if>
			
			<#list startPage..endPage as i>
				<#if currentPage == i>
					<li class="active"><a href="#">#{i}<span class="sr-only">(current)</span></a></li>
				<#else>
					<li><a href="#" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${i}')">#{i}</a><li>
				</#if>
			</#list>
			
			<#if ((totalPage - currentPage) >= 8)>
				<li><a href="#" class="gap">…</a></li>
				<li><a href="#" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${totalPage - 1}')">#{totalPage - 1}</a><li>
				<li><a href="#" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${totalPage}')">#{totalPage}</a><li>
			</#if>
			
			<#if (currentPage == totalPage)>
				<li class="disabled">
				      <a href="#" aria-label="Next">
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </li>
			<#else>
				<li>
				      <a href="#" aria-label="Next" onclick="loadUIAndRender('${actionUrl}','${ui}&pno=${currentPage + 1}')" >
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </li>
			</#if>
			
	</ul>
	<#if totalRows??>
		<ul  style="float:right;list-style:none;"><li>（共${totalRows}条记录）</li></ul>
			</#if>
</#macro>